(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
times(x, y) → sum(generate(x, y))
generate(x, y) → gen(x, y, 0)
gen(x, y, z) → if(ge(z, x), x, y, z)
if(true, x, y, z) → nil
if(false, x, y, z) → cons(y, gen(x, y, s(z)))
sum(nil) → 0
sum(cons(0, xs)) → sum(xs)
sum(cons(s(x), xs)) → s(sum(cons(x, xs)))
ge(x, 0) → true
ge(0, s(y)) → false
ge(s(x), s(y)) → ge(x, y)
Rewrite Strategy: FULL
(1) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(2) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
times(x, y) → sum(generate(x, y))
generate(x, y) → gen(x, y, 0')
gen(x, y, z) → if(ge(z, x), x, y, z)
if(true, x, y, z) → nil
if(false, x, y, z) → cons(y, gen(x, y, s(z)))
sum(nil) → 0'
sum(cons(0', xs)) → sum(xs)
sum(cons(s(x), xs)) → s(sum(cons(x, xs)))
ge(x, 0') → true
ge(0', s(y)) → false
ge(s(x), s(y)) → ge(x, y)
S is empty.
Rewrite Strategy: FULL
(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(4) Obligation:
TRS:
Rules:
times(x, y) → sum(generate(x, y))
generate(x, y) → gen(x, y, 0')
gen(x, y, z) → if(ge(z, x), x, y, z)
if(true, x, y, z) → nil
if(false, x, y, z) → cons(y, gen(x, y, s(z)))
sum(nil) → 0'
sum(cons(0', xs)) → sum(xs)
sum(cons(s(x), xs)) → s(sum(cons(x, xs)))
ge(x, 0') → true
ge(0', s(y)) → false
ge(s(x), s(y)) → ge(x, y)
Types:
times :: 0':s → 0':s → 0':s
sum :: nil:cons → 0':s
generate :: 0':s → 0':s → nil:cons
gen :: 0':s → 0':s → 0':s → nil:cons
0' :: 0':s
if :: true:false → 0':s → 0':s → 0':s → nil:cons
ge :: 0':s → 0':s → true:false
true :: true:false
nil :: nil:cons
false :: true:false
cons :: 0':s → nil:cons → nil:cons
s :: 0':s → 0':s
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_nil:cons5_0 :: Nat → nil:cons
(5) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
sum,
gen,
geThey will be analysed ascendingly in the following order:
ge < gen
(6) Obligation:
TRS:
Rules:
times(
x,
y) →
sum(
generate(
x,
y))
generate(
x,
y) →
gen(
x,
y,
0')
gen(
x,
y,
z) →
if(
ge(
z,
x),
x,
y,
z)
if(
true,
x,
y,
z) →
nilif(
false,
x,
y,
z) →
cons(
y,
gen(
x,
y,
s(
z)))
sum(
nil) →
0'sum(
cons(
0',
xs)) →
sum(
xs)
sum(
cons(
s(
x),
xs)) →
s(
sum(
cons(
x,
xs)))
ge(
x,
0') →
truege(
0',
s(
y)) →
falsege(
s(
x),
s(
y)) →
ge(
x,
y)
Types:
times :: 0':s → 0':s → 0':s
sum :: nil:cons → 0':s
generate :: 0':s → 0':s → nil:cons
gen :: 0':s → 0':s → 0':s → nil:cons
0' :: 0':s
if :: true:false → 0':s → 0':s → 0':s → nil:cons
ge :: 0':s → 0':s → true:false
true :: true:false
nil :: nil:cons
false :: true:false
cons :: 0':s → nil:cons → nil:cons
s :: 0':s → 0':s
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_nil:cons5_0 :: Nat → nil:cons
Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_nil:cons5_0(0) ⇔ nil
gen_nil:cons5_0(+(x, 1)) ⇔ cons(0', gen_nil:cons5_0(x))
The following defined symbols remain to be analysed:
sum, gen, ge
They will be analysed ascendingly in the following order:
ge < gen
(7) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
sum(
gen_nil:cons5_0(
n7_0)) →
gen_0':s4_0(
0), rt ∈ Ω(1 + n7
0)
Induction Base:
sum(gen_nil:cons5_0(0)) →RΩ(1)
0'
Induction Step:
sum(gen_nil:cons5_0(+(n7_0, 1))) →RΩ(1)
sum(gen_nil:cons5_0(n7_0)) →IH
gen_0':s4_0(0)
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(8) Complex Obligation (BEST)
(9) Obligation:
TRS:
Rules:
times(
x,
y) →
sum(
generate(
x,
y))
generate(
x,
y) →
gen(
x,
y,
0')
gen(
x,
y,
z) →
if(
ge(
z,
x),
x,
y,
z)
if(
true,
x,
y,
z) →
nilif(
false,
x,
y,
z) →
cons(
y,
gen(
x,
y,
s(
z)))
sum(
nil) →
0'sum(
cons(
0',
xs)) →
sum(
xs)
sum(
cons(
s(
x),
xs)) →
s(
sum(
cons(
x,
xs)))
ge(
x,
0') →
truege(
0',
s(
y)) →
falsege(
s(
x),
s(
y)) →
ge(
x,
y)
Types:
times :: 0':s → 0':s → 0':s
sum :: nil:cons → 0':s
generate :: 0':s → 0':s → nil:cons
gen :: 0':s → 0':s → 0':s → nil:cons
0' :: 0':s
if :: true:false → 0':s → 0':s → 0':s → nil:cons
ge :: 0':s → 0':s → true:false
true :: true:false
nil :: nil:cons
false :: true:false
cons :: 0':s → nil:cons → nil:cons
s :: 0':s → 0':s
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_nil:cons5_0 :: Nat → nil:cons
Lemmas:
sum(gen_nil:cons5_0(n7_0)) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)
Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_nil:cons5_0(0) ⇔ nil
gen_nil:cons5_0(+(x, 1)) ⇔ cons(0', gen_nil:cons5_0(x))
The following defined symbols remain to be analysed:
ge, gen
They will be analysed ascendingly in the following order:
ge < gen
(10) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
ge(
gen_0':s4_0(
n284_0),
gen_0':s4_0(
n284_0)) →
true, rt ∈ Ω(1 + n284
0)
Induction Base:
ge(gen_0':s4_0(0), gen_0':s4_0(0)) →RΩ(1)
true
Induction Step:
ge(gen_0':s4_0(+(n284_0, 1)), gen_0':s4_0(+(n284_0, 1))) →RΩ(1)
ge(gen_0':s4_0(n284_0), gen_0':s4_0(n284_0)) →IH
true
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(11) Complex Obligation (BEST)
(12) Obligation:
TRS:
Rules:
times(
x,
y) →
sum(
generate(
x,
y))
generate(
x,
y) →
gen(
x,
y,
0')
gen(
x,
y,
z) →
if(
ge(
z,
x),
x,
y,
z)
if(
true,
x,
y,
z) →
nilif(
false,
x,
y,
z) →
cons(
y,
gen(
x,
y,
s(
z)))
sum(
nil) →
0'sum(
cons(
0',
xs)) →
sum(
xs)
sum(
cons(
s(
x),
xs)) →
s(
sum(
cons(
x,
xs)))
ge(
x,
0') →
truege(
0',
s(
y)) →
falsege(
s(
x),
s(
y)) →
ge(
x,
y)
Types:
times :: 0':s → 0':s → 0':s
sum :: nil:cons → 0':s
generate :: 0':s → 0':s → nil:cons
gen :: 0':s → 0':s → 0':s → nil:cons
0' :: 0':s
if :: true:false → 0':s → 0':s → 0':s → nil:cons
ge :: 0':s → 0':s → true:false
true :: true:false
nil :: nil:cons
false :: true:false
cons :: 0':s → nil:cons → nil:cons
s :: 0':s → 0':s
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_nil:cons5_0 :: Nat → nil:cons
Lemmas:
sum(gen_nil:cons5_0(n7_0)) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)
ge(gen_0':s4_0(n284_0), gen_0':s4_0(n284_0)) → true, rt ∈ Ω(1 + n2840)
Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_nil:cons5_0(0) ⇔ nil
gen_nil:cons5_0(+(x, 1)) ⇔ cons(0', gen_nil:cons5_0(x))
The following defined symbols remain to be analysed:
gen
(13) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol gen.
(14) Obligation:
TRS:
Rules:
times(
x,
y) →
sum(
generate(
x,
y))
generate(
x,
y) →
gen(
x,
y,
0')
gen(
x,
y,
z) →
if(
ge(
z,
x),
x,
y,
z)
if(
true,
x,
y,
z) →
nilif(
false,
x,
y,
z) →
cons(
y,
gen(
x,
y,
s(
z)))
sum(
nil) →
0'sum(
cons(
0',
xs)) →
sum(
xs)
sum(
cons(
s(
x),
xs)) →
s(
sum(
cons(
x,
xs)))
ge(
x,
0') →
truege(
0',
s(
y)) →
falsege(
s(
x),
s(
y)) →
ge(
x,
y)
Types:
times :: 0':s → 0':s → 0':s
sum :: nil:cons → 0':s
generate :: 0':s → 0':s → nil:cons
gen :: 0':s → 0':s → 0':s → nil:cons
0' :: 0':s
if :: true:false → 0':s → 0':s → 0':s → nil:cons
ge :: 0':s → 0':s → true:false
true :: true:false
nil :: nil:cons
false :: true:false
cons :: 0':s → nil:cons → nil:cons
s :: 0':s → 0':s
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_nil:cons5_0 :: Nat → nil:cons
Lemmas:
sum(gen_nil:cons5_0(n7_0)) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)
ge(gen_0':s4_0(n284_0), gen_0':s4_0(n284_0)) → true, rt ∈ Ω(1 + n2840)
Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_nil:cons5_0(0) ⇔ nil
gen_nil:cons5_0(+(x, 1)) ⇔ cons(0', gen_nil:cons5_0(x))
No more defined symbols left to analyse.
(15) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
sum(gen_nil:cons5_0(n7_0)) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)
(16) BOUNDS(n^1, INF)
(17) Obligation:
TRS:
Rules:
times(
x,
y) →
sum(
generate(
x,
y))
generate(
x,
y) →
gen(
x,
y,
0')
gen(
x,
y,
z) →
if(
ge(
z,
x),
x,
y,
z)
if(
true,
x,
y,
z) →
nilif(
false,
x,
y,
z) →
cons(
y,
gen(
x,
y,
s(
z)))
sum(
nil) →
0'sum(
cons(
0',
xs)) →
sum(
xs)
sum(
cons(
s(
x),
xs)) →
s(
sum(
cons(
x,
xs)))
ge(
x,
0') →
truege(
0',
s(
y)) →
falsege(
s(
x),
s(
y)) →
ge(
x,
y)
Types:
times :: 0':s → 0':s → 0':s
sum :: nil:cons → 0':s
generate :: 0':s → 0':s → nil:cons
gen :: 0':s → 0':s → 0':s → nil:cons
0' :: 0':s
if :: true:false → 0':s → 0':s → 0':s → nil:cons
ge :: 0':s → 0':s → true:false
true :: true:false
nil :: nil:cons
false :: true:false
cons :: 0':s → nil:cons → nil:cons
s :: 0':s → 0':s
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_nil:cons5_0 :: Nat → nil:cons
Lemmas:
sum(gen_nil:cons5_0(n7_0)) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)
ge(gen_0':s4_0(n284_0), gen_0':s4_0(n284_0)) → true, rt ∈ Ω(1 + n2840)
Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_nil:cons5_0(0) ⇔ nil
gen_nil:cons5_0(+(x, 1)) ⇔ cons(0', gen_nil:cons5_0(x))
No more defined symbols left to analyse.
(18) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
sum(gen_nil:cons5_0(n7_0)) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)
(19) BOUNDS(n^1, INF)
(20) Obligation:
TRS:
Rules:
times(
x,
y) →
sum(
generate(
x,
y))
generate(
x,
y) →
gen(
x,
y,
0')
gen(
x,
y,
z) →
if(
ge(
z,
x),
x,
y,
z)
if(
true,
x,
y,
z) →
nilif(
false,
x,
y,
z) →
cons(
y,
gen(
x,
y,
s(
z)))
sum(
nil) →
0'sum(
cons(
0',
xs)) →
sum(
xs)
sum(
cons(
s(
x),
xs)) →
s(
sum(
cons(
x,
xs)))
ge(
x,
0') →
truege(
0',
s(
y)) →
falsege(
s(
x),
s(
y)) →
ge(
x,
y)
Types:
times :: 0':s → 0':s → 0':s
sum :: nil:cons → 0':s
generate :: 0':s → 0':s → nil:cons
gen :: 0':s → 0':s → 0':s → nil:cons
0' :: 0':s
if :: true:false → 0':s → 0':s → 0':s → nil:cons
ge :: 0':s → 0':s → true:false
true :: true:false
nil :: nil:cons
false :: true:false
cons :: 0':s → nil:cons → nil:cons
s :: 0':s → 0':s
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_nil:cons5_0 :: Nat → nil:cons
Lemmas:
sum(gen_nil:cons5_0(n7_0)) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)
Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_nil:cons5_0(0) ⇔ nil
gen_nil:cons5_0(+(x, 1)) ⇔ cons(0', gen_nil:cons5_0(x))
No more defined symbols left to analyse.
(21) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
sum(gen_nil:cons5_0(n7_0)) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)
(22) BOUNDS(n^1, INF)